home *** CD-ROM | disk | FTP | other *** search
/ Freelog 15 / FREELOG 15.ISO / WebMaster / Perl / PERL5106.ZIP / perl5 / ntt / Op / read.ntt < prev    next >
Encoding:
Text File  |  1995-11-07  |  551 b   |  21 lines

  1. #!./perl
  2.  
  3. # $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $
  4.  
  5. print "1..4\n";
  6.  
  7. # WYT 1995-05-02 changed file extensions from .t to .ntt
  8. open(FOO,'op/read.ntt') || open(FOO,'t/op/read.ntt') || die "Can't open op.read";
  9.  
  10. seek(FOO,4,0);
  11. $got = read(FOO,$buf,4);
  12.  
  13. print ($got == 4 ? "ok 1\n" : "not ok 1\n");
  14. print ($buf eq "perl" ? "ok 2\n" : "not ok 2 :$buf:\n");
  15.  
  16. seek (FOO,0,2) || seek(FOO,20000,0);
  17. $got = read(FOO,$buf,4);
  18.  
  19. print ($got == 0 ? "ok 3\n" : "not ok 3\n");
  20. print ($buf eq "" ? "ok 4\n" : "not ok 4\n");
  21.